package com.ruoyi.system.domain.vo;

/**
 * @create: 2020-06-03 14:35
 * 短信模板枚举类；参考短信服务商中申请的短信模板进行配置
 **/
public enum MessageTemplate {

    T_MEMBER_REGISTER("SMS_198000045", "{\"code\":\"$$\"}"),

    T_MEMBER_UPDATE_PWD("SMS_224455036", "{\"code\":\"$$\"}"),
    T_MEMBER_LOGIN("SMS_198000047", "{\"code\":\"$$\"}"),
    //小程序绑定手机号
    T_MEMBER_BINDPHONE("SMS_198000048", "{\"code\":\"$$\"}"),
    T_MEMBER_VIP("", "");

    private String code;

    private String param;

    MessageTemplate(String code, String param) {
        this.code = code;
        this.param = param;
    }

    public static MessageTemplate getTemplate(int index) {
        MessageTemplate[] array = values();
        for (MessageTemplate messageTemplate : array) {
            if (messageTemplate.ordinal() == index) {
                return messageTemplate;
            }
        }
        return T_MEMBER_REGISTER;
    }

    public String getCode() {
        return code;
    }

    public String getParam() {
        return param;
    }

    public static void main(String[] args) {
        System.out.println(getTemplate(1).getCode());
    }
}
